package org.lookahead.parent.apidoc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@AllArgsConstructor
@Getter
public enum IntegralEnum {

    OBJECTIVE_QUESTION(0, 2, true, "客观题目*2分（试题，来源试题ID）"),
    DUBBING_QUESTION(1, 10, true, "试题配音*10分（来源试题ID）"),
    MODULE_ALL(2, 20, false, "模块*20（所有节点完成，来源模块ID）"),
    PICTURE_BOOK_READ(3, 10, false, "绘本阅读*10分（来源绘本ID）"),
    PICTURE_BOOK_FOLLOW(4, 10, false, "绘本跟读10分（来源绘本ID）"),
    PICTURE_BOOK_WORLD(5, 2, true, "绘本读单词*2分（来源读单词ID）"),
    ARTICLE_SUMMARIZE(6, 10, false, "语篇归纳10份（来源绘本ID）"),
    ;

    static final Map<Integer, IntegralEnum> typeIntegralMap = new HashMap<>();

    static {
        for (IntegralEnum integralEnum : IntegralEnum.values()) {
            typeIntegralMap.put(integralEnum.getType(), integralEnum);
        }
    }
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 分值
     */
    private final Integer value;
    /**
     *
     */
    private final Boolean multiple;
    /**
     * 备注
     */
    private final String memo;

    public static IntegralEnum getByType(Integer type) {
        return typeIntegralMap.get(type);
    }

}
